cmake_minimum_required(VERSION 3.22)

project(ext_lib CXX C)
message(STATUS "Building project: ${PROJECT_NAME}")

option(GET_EXT_LIB_ONLINE "Use the external libraries from the internet" ON)

if (GET_EXT_LIB_ONLINE)
    set(LIBUV_SITE https://gitee.com/zh0uyun/libuv.git)
else()
    set(LIBUV_SITE E:/ThirdParty/libuv)
endif()
include(ExternalProject)
ExternalProject_Add(
    libuv_package
    GIT_REPOSITORY ${LIBUV_SITE}
    GIT_TAG v1.48.0
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}
    CMAKE_ARGS -DLIBUV_BUILD_TESTS=OFF
    CMAKE_ARGS -DLIBUV_BUILD_BENCH=OFF
)
